package cn.dlust.tt.module.teacher.dal.mysql.lessonplans;

import java.util.*;

import cn.dlust.tt.framework.common.pojo.PageResult;
import cn.dlust.tt.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.dlust.tt.framework.mybatis.core.mapper.BaseMapperX;
import cn.dlust.tt.module.teacher.dal.dataobject.lessonplans.LessonPlansDO;
import org.apache.ibatis.annotations.Mapper;
import cn.dlust.tt.module.teacher.controller.admin.lessonplans.vo.*;

/**
 * 教案 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface LessonPlansMapper extends BaseMapperX<LessonPlansDO> {

    default PageResult<LessonPlansDO> selectPage(LessonPlansPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<LessonPlansDO>()
                .eqIfPresent(LessonPlansDO::getCourseId, reqVO.getCourseId())
                .eqIfPresent(LessonPlansDO::getTitle, reqVO.getTitle())
                .eqIfPresent(LessonPlansDO::getContent, reqVO.getContent())
                .orderByDesc(LessonPlansDO::getPlanId));
    }

}